"""通过按钮获得 entry上的内容 并赋值到某个变量"""
import tkinter
win=tkinter.Tk()
win.geometry("400x500+100+200")
win.title("按钮练习")
def showInfo():
    print(entry1.get())

entry1=tkinter.Entry()
button1=tkinter.Button(win,text="点我试试",width=10,height=5,command=showInfo)




entry1.pack()
button1.pack()








win.mainloop()